<?php
//准备装载数据
	require_once("./includes/configure.php");
	require_once("./includes/database.php");
	$db = Database::Connect();
	$zufang_quyu_array = $db->getConfigurationArray('zufang_quyu');
	$zufang_xianlu_array = $db->getConfigurationArray('zufang_xianlu');
	$zufang_shoujia_array = $db->getConfigurationArray('ershoufang_shoujia');
	$zufang_zujin_array = $db->getConfigurationArray('zufang_zujin');
	$ershoufang_mianji_array = $db->getConfigurationArray('ershoufang_mianji');
	$zufang_fangxing_array = $db->getConfigurationArray('zufang_fangxing');
	$ershoufang_leixing_array = $db->getConfigurationArray('zufang_leixing');

	//处理url,用的时候啥子都不管,只是显示上处理
	if(true){
		//$current_url = 'http://'.$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
		//$current_url = 'http://'.$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
		require_once("./includes/func.php");
		$current_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']."?".initUrl($_SERVER['QUERY_STRING']);
		//挨着拼接url
		//第一个问号
		if(!strpos($current_url,"?")){
			$current_url .= '?sj=lx';
		}
	}
?>
<div class="fcklinks">
<div style="height: 8px; *height: 10px;"><span></span></div>
<div id="panel_apf_id_9" class="condition_links2 condition_link2_def">
<div>
<div class="condition_title">区域：</div>
<div id="apf_id_9_areacontainer" class="container">
<?php echo '<a href="'.deleteRepeatVar($current_url,'quyu').'">';
	if(!$_GET['quyu']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
<?php
	for($ii=0;$ii<count($zufang_quyu_array);$ii++){
		if($_GET['quyu']==$zufang_quyu_array[$ii]['this_id']){
			echo '<a href="'.deleteRepeatVar($current_url,'quyu').'&quyu='.$zufang_quyu_array[$ii]['this_id'].'" title="'.$zufang_quyu_array[$ii]['value'].'"><strong>'.$zufang_quyu_array[$ii]['value'].'</strong></a>';
		}else{
			echo '<a href="'.deleteRepeatVar($current_url,'quyu').'&quyu='.$zufang_quyu_array[$ii]['this_id'].'" title="'.$zufang_quyu_array[$ii]['value'].'">'.$zufang_quyu_array[$ii]['value'].'</a>';
		}
	}
?>
<?php
		if($_GET['quyu'] && is_numeric($_GET['quyu'])){
			$zufang_quyu2_array = $db->getConfigurationArray2('zufang_shangquan',$_GET['quyu']);
			//区域下级
			$quyu2_right = false;
			for($ii=0;$ii<count($zufang_quyu2_array);$ii++){
				if($_GET['quyu2']==$zufang_quyu2_array[$ii]['this_id']){
					$quyu2_right = true;
					break;
				}
			}
			if(!$quyu2_right){
				$_GET['quyu2'] = null;
			}
			echo '<div style="border: 1px solid #F39800;margin-right: 10px;padding: 0 0 0 6px;">';
				echo '<a href="'.deleteRepeatVar($current_url,'quyu2').'">';
				if(!$_GET['quyu2']){
					echo '<strong>不限</strong></a>';
				}else{
					echo '不限</a>';
				}
		
				for($ii=0;$ii<count($zufang_quyu2_array);$ii++){
					if($_GET['quyu2']==$zufang_quyu2_array[$ii]['this_id']){
						echo '<a href="'.deleteRepeatVar($current_url,'quyu2').'&quyu2='.$zufang_quyu2_array[$ii]['this_id'].'"  title="'.$zufang_quyu2_array[$ii]['value'].'"><strong>'.$zufang_quyu2_array[$ii]['value'].'</strong></a>';
					}else{
						echo '<a href="'.deleteRepeatVar($current_url,'quyu2').'&quyu2='.$zufang_quyu2_array[$ii]['this_id'].'"  title="'.$zufang_quyu2_array[$ii]['value'].'">'.$zufang_quyu2_array[$ii]['value'].'</a>';
					}
				}
			echo '</div>';
		}
	?>
</div>
</div>

<div style="display:none;">
<div class="condition_title">线路：</div>
<div id="apf_id_9_areacontainer" class="container">
<?php echo '<a href="'.deleteRepeatVar($current_url,'xianlu').'">';
	if(!$_GET['xianlu']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
	<?php
		for($ii=0;$ii<count($zufang_xianlu_array);$ii++){
			if($_GET['xianlu']==$zufang_xianlu_array[$ii]['this_id']){
				echo '<a href="'.deleteRepeatVar($current_url,'xianlu').'&xianlu='.$zufang_xianlu_array[$ii]['this_id'].'" title="'.$zufang_xianlu_array[$ii]['value'].'"><strong>'.$zufang_xianlu_array[$ii]['value'].'</strong></a>';
			}else{
				echo '<a href="'.deleteRepeatVar($current_url,'xianlu').'&xianlu='.$zufang_xianlu_array[$ii]['this_id'].'" title="'.$zufang_xianlu_array[$ii]['value'].'">'.$zufang_xianlu_array[$ii]['value'].'</a>';
			}
		}
	?>
</div>
</div>
<?php if($_GET['cond'] == 'qiugou'){
?>
<div>
<div class="condition_title">售价：</div>
<div class="containerprice">
<?php echo '<a href="'.deleteRepeatVar($current_url,'shoujia').'">';
	if(!$_GET['shoujia']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
<?php
	for($ii=0;$ii<count($zufang_shoujia_array);$ii++){
		if($_GET['shoujia']==$zufang_shoujia_array[$ii]['value']){
			echo '<a href="'.deleteRepeatVar($current_url,'shoujia').'&shoujia='.$zufang_shoujia_array[$ii]['value'].'"  title="'.$zufang_shoujia_array[$ii]['C'].'"><strong>'.$zufang_shoujia_array[$ii]['C'].'</strong></a> &nbsp;';
		}else{
			echo '<a href="'.deleteRepeatVar($current_url,'shoujia').'&shoujia='.$zufang_shoujia_array[$ii]['value'].'"  title="'.$zufang_shoujia_array[$ii]['C'].'">'.$zufang_shoujia_array[$ii]['C'].'</a> &nbsp;';
		}
	}
?>
</div>
</div>

<div>
<div class="condition_title">面积：</div>
<div class="containerprice">
<?php echo '<a href="'.deleteRepeatVar($current_url,'mianji').'">';
	if(!$_GET['mianji']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
<?php
	for($ii=0;$ii<count($ershoufang_mianji_array);$ii++){
		if($_GET['mianji']==$ershoufang_mianji_array[$ii]['value']){
			echo '<a href="'.deleteRepeatVar($current_url,'mianji').'&mianji='.$ershoufang_mianji_array[$ii]['value'].'"  title="'.$ershoufang_mianji_array[$ii]['C'].'"><strong>'.$ershoufang_mianji_array[$ii]['C'].'</strong></a> &nbsp;';
		}else{
			echo '<a href="'.deleteRepeatVar($current_url,'mianji').'&mianji='.$ershoufang_mianji_array[$ii]['value'].'"  title="'.$ershoufang_mianji_array[$ii]['C'].'">'.$ershoufang_mianji_array[$ii]['C'].'</a> &nbsp;';
		}
	}
?>
</div>
</div>

<?php
}else if($_GET['cond'] == 'qiuzu'){
?>
<div>
<div class="condition_title">租金：</div>
<div class="containerprice">
<?php echo '<a href="'.deleteRepeatVar($current_url,'zujin').'">';
	if(!$_GET['zujin']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
<?php
	for($ii=0;$ii<count($zufang_zujin_array);$ii++){
		if($_GET['zujin']==$zufang_zujin_array[$ii]['value']){
			echo '<a href="'.deleteRepeatVar($current_url,'zujin').'&zujin='.$zufang_zujin_array[$ii]['value'].'"  title="'.$zufang_zujin_array[$ii]['C'].'"><strong>'.$zufang_zujin_array[$ii]['C'].'</strong></a>';
		}else{
			echo '<a href="'.deleteRepeatVar($current_url,'zujin').'&zujin='.$zufang_zujin_array[$ii]['value'].'"  title="'.$zufang_zujin_array[$ii]['C'].'">'.$zufang_zujin_array[$ii]['C'].'</a>';
		}
	}
?>
</div>
</div>
<?
}
?>

<div>
<div class="condition_title">户型：</div>
<div class="container">
<?php echo '<a href="'.deleteRepeatVar($current_url,'huxing').'">';
	if(!$_GET['huxing']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
<?php
	for($ii=0;$ii<count($zufang_fangxing_array);$ii++){
		if($_GET['huxing']==$zufang_fangxing_array[$ii]['value']){
			echo '<a href="'.deleteRepeatVar($current_url,'huxing').'&huxing='.$zufang_fangxing_array[$ii]['value'].'"  title="'.$zufang_fangxing_array[$ii]['C'].'"><strong>'.$zufang_fangxing_array[$ii]['C'].'</strong></a>';
		}else{
			echo '<a href="'.deleteRepeatVar($current_url,'huxing').'&huxing='.$zufang_fangxing_array[$ii]['value'].'"  title="'.$zufang_fangxing_array[$ii]['C'].'">'.$zufang_fangxing_array[$ii]['C'].'</a>';
		}
	}
?>
</div>
</div>

<?php if($_GET['cond'] == 'qiugou'){
?>
<div>
<div class="condition_title">类型：</div>
<div class="container">
<?php echo '<a href="'.deleteRepeatVar($current_url,'leixing').'">';
	if(!$_GET['leixing']){
		echo '<strong>不限</strong></a>';
	}else{
		echo '不限</a>';
	}
?>
<?php
	for($ii=0;$ii<count($ershoufang_leixing_array);$ii++){
		if($_GET['leixing']==$ershoufang_leixing_array[$ii]['value']){
			echo '<a href="'.deleteRepeatVar($current_url,'leixing').'&leixing='.$ershoufang_leixing_array[$ii]['value'].'"  title="'.$ershoufang_leixing_array[$ii]['C'].'"><strong>'.$ershoufang_leixing_array[$ii]['C'].'</strong></a>';
		}else{
			echo '<a href="'.deleteRepeatVar($current_url,'leixing').'&leixing='.$ershoufang_leixing_array[$ii]['value'].'"  title="'.$ershoufang_leixing_array[$ii]['C'].'">'.$ershoufang_leixing_array[$ii]['C'].'</a>';
		}
	}
?>
</div>
</div>
<?php
}
?>
</div>
<div class="condition_fake_352"></div>
</div>
<?php
$db->close();
?>